<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no" />
    <title>添加银行卡</title>
    <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../../css/common.css"/>
    <style>
        body,html{
            background: #f3f3f3;
            font-size: 14px;
            overflow: hidden;
            width: 100%;
        }
        .aui-icon-left{
            padding-left:10px;
        }

        .aui-slide-page-active{
            background: #327afa;
        }
        header {
            width: 100%;
            height: 45px;
            background: #fff;
            position: relative;
            z-index: 9;
            /*margin-bottom: 15px;*/
        }
        .win_title{
            text-align: center;
            width: 100%;
            line-height: 45px;
            height: 45px;
            font-size: 16px;
        }
        .aui-iconfont{
         position: absolute;
        }
        .aui-list-view:after{
            border:none;
        }
        .aui-pull-right{
            margin-right:20px;
        }
        .cancel{
            background: #d7e5ff;
            border-color: #d7e5ff;
            color: #327afa;
            width: 50%;
            float: left;
        }
        .confirm{
            width: 50%;
            float: left;
        }
        input.inputCardNo{
            line-height: 25px;
            margin: 0;
            width: inherit;
            padding: 0;
            border: 0;
            width: 80%;
        }
        .myBtn{
           /* position: fixed;
            bottom: 0;*/
            width: 90%;
            margin: 0 auto;
        }
        .myBtn.disable{
            background: #d9d9d9;
            color: #bababa;
        }
        .aui-btn-block{
            width: 50%;
            margin: 0 auto;
            padding: 10px;
        }
        .aui-btn-info.aui-btn-outlined{
            color:#327afa;
        }
        .aui-btn-info{
            border: 1px solid #327afa;
            margin-top: 30px;
        }
        .aui-btn-info:visited{

        }
        .spanOk{
            display: block;
            border-radius: 50%;
            width: 50px;
            height: 50px;
            background: #ff3333;
            position: relative;
            margin: 0 auto;
            margin-bottom: 10px;
        }
        .spanOk:before{
            position: absolute;
            content: "\e645";
            left: 26%;
            top:10%;
            color: #fff;
            font-size: 25px;
        }
        .ok{
            text-align: center;
        }
        .result{
            margin-top: 50px;
            display: none;
        }
        .headerCardInfo{
            display: none;
        }
        .contain{
            width: 200%;
            transition: .5s;
        }
        .writeCardNo,.writeCardInfo{
            width: 50%;
            float: left;
        }
        .phone.aui-list-view{
            margin-bottom: 0px;
        }
        .showCardInfo{
            -webkit-transform: translateX(-50%);
        }
        .cardTips{
            padding:5px 15px;
            font-size: 12px;
        }
        .writeCardInfo input{
            border:none !important;
            margin: 0 !important;
            width: 70% !important;
            padding: 0 !important;
        }
        .fuwu input[type="checkbox"]{
            vertical-align:middle;
            margin-right: 5px;
            width: inherit !important;
        }
    </style>
</head>
<body>
    <header class="myBorder">
        <div class="win_title aui-border-b headerCardNo"> 
            <div class="aui-pull-left aui-iconfont aui-icon-left icon-left-coler" tapmode onclick="closeWin()"></div>
            <div class="">
                添加银行卡
            </div>
        </div> 
        <div class="win_title aui-border-b headerCardInfo"> 
            <div class="aui-pull-left aui-iconfont aui-icon-left icon-left-coler" tapmode onclick="showCardInfoBack()"></div>
            <div class="">
                填写银行卡信息
            </div>
        </div> 
    </header>
    <div class="contain">
        <div class="writeCardNo">
            <ul class="aui-list-view">
                <li class="aui-list-view-cell" >
                    <span>卡号</span>
                    <input type="text"  name="" placeholder="银行卡号" onpropertychange="checkCard(this)" oninput="checkCard(this)" class="inputCardNo" name="" value="">
                </li>
            </ul>  
            <div class="myBtn disable btnCardNo" tapmode >下一步</div> 
        </div> 
        <div class="writeCardInfo">
            <div class="cardTips">
                信息加密处理，仅用于银行验证
            </div>
            <ul class="aui-list-view">
                <li class="aui-list-view-cell" >
                    <span>卡类型</span>
                    中国农业银行储蓄卡
                </li>
            </ul>  
            <ul class="aui-list-view">
                <li class="aui-list-view-cell" >
                    <span>姓名</span>
                    <input type="number"  name="" placeholder="真实姓名" value="">
                </li>
                <li class="aui-list-view-cell" >
                    <span>证件类型</span>
                    <span class="active">身份证</span>
                </li>
                <li class="aui-list-view-cell" >
                    <span>证件号</span>
                    <input type="number"  name="" placeholder="证件号" value="">
                </li>
            </ul>  
            <ul class="aui-list-view phone">
                <li class="aui-list-view-cell" >
                    <span>手机号</span>
                    <input type="number"  placeholder="留在银行手机号" value="">
                </li>
            </ul>  
            <div class="fuwu cardTips">
                <input type="checkbox" name="" id="agree">同意<label for="agree" class="active">《服务协议》</label>
            </div>
            <div class="myBtn btnCardInfo" tapmode onclick="CardInfoNext()">下一步</div> 
        </div> 
    </div>
    <!-- 控制影藏显示 -->
    <div class="result">
        <div class="ok">
            <span class="aui-iconfont aui-icon-check spanOk"></span>
            <p>修改成功</p>
        </div>
        <div class="aui-btn aui-btn-info aui-btn-block aui-btn-outlined">
        去首页</div>
    </div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript" src="../../script/doT.min.js"></script>
<script type="text/javascript" src="../../script/jquery-1.11.3.js"></script>
<script type="text/javascript">
   apiready = function() {
       api.parseTapmode();
       var mobile = api.pageParam.mobile;
       var header = $api.dom('header');
       var footer = $api.dom('footer');
       //$api.fixStatusBar(header);
       api.setStatusBarStyle({
             style : 'light'
       });
   }
   function checkCard(obj){
        // 四位数一个空格
        var cardNo=$(obj).val().replace(/\D/g,"").replace(/(\d{4})(?=\d)/g,"$1 ");
        var cardNoShort=$(obj).val().replace(/\s/g,"");//没有空格的
        $(".inputCardNo").val(cardNo);
            if((cardNoShort.length>=18)&&(cardNoShort.length<21)){
                $(".btnCardNo").removeClass("disable");
                $(".btnCardNo").attr({"onclick":"next()"});
        }else if(cardNoShort.length>=21){
              $(".inputCardNo").val(cardNoShort.substr(0,21).replace(/(\d{4})(?=\d)/g,"$1 "));   
        }else{
            $(".btnCardNo").addClass("disable");
            $(".btnCardNo").removeAttr("onclick");
        }
   }
   function next(){
        $(".contain").addClass("showCardInfo");
        $(".headerCardNo").css({"display":"none"});
        $(".headerCardInfo").css({"display":"block"});
   }
   function showCardInfoBack(){
        $(".contain").removeClass("showCardInfo");
        $(".headerCardNo").css({"display":"block"});
        $(".headerCardInfo").css({"display":"none"});
   }
   function CardInfoNext(){
        if($("#agree").prop("checked")){
            alert("已同意服务")
        }else{
            alert("请同意服务")
        }
   }
</script>
</html>
